package com.example.busshop.controller;

import com.example.busshop.common.controller.LogicController;
import com.example.busshop.dao.OrderDao;
import com.example.busshop.entity.LineItem;
import com.example.busshop.entity.Order;
import com.example.busshop.service.OrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Set;

@RestController
@RequestMapping("/order")
public class OrderController extends LogicController<OrderService, OrderDao, Order,Long> {
    @Resource
    OrderService orderService;
    public OrderController(OrderService ls) {
        super(ls);
    }
    @GetMapping("/getLineItem")
    public Set<LineItem> lineItemSet(Long oid){
        return orderService.getLineItems(oid);
    }
}
